const express = require('express');
const router = express.Router();
const userController = require('../controllers/userController');
const { validateUser } = require('../middlewares/validators/userValidator');
const { authenticateToken } = require('../middlewares/auth');

router.post('/login', validateUser, userController.login);
router.post('/register', validateUser, userController.register);
router.get('/verify', authenticateToken, (req, res) => {
    res.json({
        status: 'success',
        message: 'Token is valid',
        user: req.user
    });
});

module.exports = router;



